import os

basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
    SECRET_KEY = '填上你自己的'
    APP_ID = "填上你自己的"
    ACCESSKEY_ID = "填上你自己的"
    ACCESSKEY_SECRET = "填上你自己的"
    IMAGES_UPLOAD_FOLDER = '/root/upload/img'
    VIDEOS_UPLOAD_FOLDER = '/root/upload/video'
    ALLOWED_IMAGE_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
    ALLOWED_VIDEO_EXTENSIONS = set(['avi', 'wmv', 'mpeg', 'mp4', 'mov', 'flv', 'm4v'])

    @staticmethod
    def init_app(app):
        pass

#两种环境下的数据库配置
class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:填上你自己的@localhost/填上你自己的?charset=utf8mb4'

class ProductionConfig(Config):
    DEBUG = False
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:填上你自己的@localhost/填上你自己的?charset=utf8mb4'

config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
    'default': DevelopmentConfig
}
